help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: uint64 typecast can't be initialised with more than 15 decimal posit


From: Yury T.
Subject: Re: uint64 typecast can't be initialised with more than 15 decimal positions
Date: Mon, 4 Mar 2013 09:03:22 -0800 (PST)

Jordi Gutiérrez Hermoso-2 wrote
> Sure, moving material from the FAQ to the manual is fine, with the FAQ
> pointing to the manual is good. Do you have a suggestion on how to
> reword the manual?

Yes, but I can't jump in rewriting right now. Generally, on the lines of
what I'm talking about here. BTW, I have already partly rewritten several
manual fragments on complex datatypes (as mentioned in the previous
discussion). Only it's in Russian (but translates adequately with Google),
and not finished (I remade only the parts of immediate concern to me). I can
post it as a work-in-progress somewhere.


Jordi Gutiérrez Hermoso-2 wrote
>> Also, talking about integers presupposes talking about *limits, not
>> precision* -- how big are the integer numbers you can use with the help
>> of
>> data types: uint32, uint64 etc.
> 
> That is precision:
> 
>     http://en.wikipedia.org/wiki/Precision_%28computer_science%29

Most definitely it is NOT. Even as wiki-entry says, precision is an amount
of detail, and you can't be any more detailed with machine-represented
integer, as you already are. One is one. But there are magnitude limits.


Jordi Gutiérrez Hermoso-2 wrote
>> If uint64() works by converting its input somehow through the IEEE floats
>> (16 positions after the decimal point), than it is doing it wrong,
>> anyway.
> 
> I suppose the FAQ entry isn't clear. The problem isn't uint64, but
> that the Octave and Matlab languages don't have integer literals. Any
> numerical literal is first read by the interpreter as a double. With
> JITC, sometimes you can optimise this and guess the type, but this is
> just a transparent optimisation. The semantics of the language do not
> allow integer literals.

If the function silently rounds the integer (!!), then the function's, well,
functioning is wrong, wrong and, once again, wrong. The only rational
decision would be to limit the interpreter input by number of decimal places
(and throw an error) or, better yet, to throw a rounding error in such
cases. Definitely not silently round the supposedly integer input.




--
View this message in context: 
http://octave.1599824.n4.nabble.com/uint64-typecast-can-t-be-initialised-with-more-than-15-decimal-positions-tp4650508p4650523.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]