[x3d-public] @startTime too big a number

John Carlson yottzumm at gmail.com
Sun Apr 3 12:31:51 PDT 2016


I think it’s an issue with the validator converting large integers to strings or longs instead of numbers (floats or doubles or in Java’s case, BigDecimal).  I will look into it.

John

> On Apr 3, 2016, at 3:28 PM, Roy Walmsley <roy.walmsley at ntlworld.com> wrote:
> 
> John,
>  
> First, it can only be a number. Why shouldn’t it be a number? It is a legal JSON number. It gets correctly generated. It’s just large!
>  
> Here it is in JSON: @startTime":999999999999999999999999999999999999
>  
> So, lets add one to it. What do we get? 1000000000000000000000000000000000000. Now, let’s add thousands separators to make it easier to count zeroes. It becomes 1,000,000,000,000,000,000,000,000,000,000,000,000. That makes 36 zeroes, assuming I can count! Now, bearing in mind that this field is an SFTime field, which is specified as a double precision floating point number (see 19775-1 5.3.15 SFTime and MFTime, http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/fieldsDef.html#SFTimeAndMFTime <http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/fieldsDef.html#SFTimeAndMFTime>)
> we could have written the number as 1.0E36. What is the range of a double precision number? Using IEEE 754 it is up to 1.0E308. So, our example is miniscule in comparison! Thus, it is perfectly legal from all points of view. It just looks huge because it is written out long hand.
>  
> From a loader perspective it needs to know that the startTime field is an SFTime field and handle the input accordingly.
>  
> Regards,
>  
> Roy
>  
> From: John Carlson [mailto:yottzumm at gmail.com] 
> Sent: 03 April 2016 19:15
> To: Don Brutzman; Roy Walmsley
> Cc: X3D Graphics public mailing list
> Subject: @startTime too big a number
>  
> I think @startTime in several places may be too big of an number, and is being treated like a string?  Not sure.  Here’s the JSON file:
> 
> 
> /www.web3d.org/x3d/content/examples//Basic/StudentProjects/IkeaBeadToy.json <http://www.web3d.org/x3d/content/examples/Basic/StudentProjects/IkeaBeadToy.json>
>  
> Perhaps  allow it to be either a string or a number?  Not sure. I guess there’s no Time type in JSON.
>  
> What is ∞ translated to?  Not that you can put it in the field.
>  
> John

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20160403/706265fa/attachment-0001.html>


More information about the x3d-public mailing list