Thank you Christopher. :)

On Tue, Feb 8, 2011 at 19:13, Christopher Wright <
christopher_wri...@apple.com> wrote:

> > I am dealing with high digit number. 1e +10 and I cannot operate a module
> % after this high number.
> > Is this 100.000.000 the highest number for module?
>
> The modulo operator as implemented in the Mathematical Expression patch
> casts the numbers (normally doubles) to 32 bit signed integers.  Because of
> that, you'll not be able to use numbers larger than ~2,147,483,647 (2^31-1)
>  for the modulo operation.
>
> Also note that you're adding small values (patch time) to gigantic values.
>  Floating point numbers don't handle that sort of thing particularly well in
> general:  often the smaller number simply disappears, or experiences odd
> rounding/truncation.
>
> For example:
>
> [this is javascript]
> > function (__number outputNumber) main (__number inputNumber[2])
> > {
> >       var result = new Object();
> >       var i = 0;
> >       result.outputNumber = inputNumber[0];
> >       for(i=0;i<10000000;++i)
> >               result.outputNumber +=  + inputNumber[1];
> >       return result;
> > }
>
> if you set the inputs to 1e10 and 0.1 respectively, you'd expect to get
> 10001000000   (1e10 + 10000000 * 0.1), but you actually get
> 10001000003.8147....
>
> that bottom cruft is due to floating point math being inexact.  This
> example exaggerates its effect by repeatedly adding (instead of multiplying
> and then adding), but it's something one must absolutely be aware of when
> mixing very large and very small numbers.
>
> --
> Christopher Wright
> christopher_wri...@apple.com
>
>
>
>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (Quartzcomposer-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to