Purpose of floating points in Ruby -


what purpose of floating number in ruby? found information using less bytes or increasing accuracy, not understand why not use floats. wouldn't give more accurate result?

in past, integer ops faster , fpu not present or optional in architecture.

however, today, fp universal, it's quite fast, , in fact is possible use fp everything.

most or javascript implementations work that.

in general, though, integer ops still faster , catalog of available operations matches more closely programmers expect. 64-bit integers map better bytes , storage system 52-bit integers provided floating point system.

a full-featured language ruby implement both integer , fp ops. gives user more of choice attribute domains, while languages more streamlined javascript may pick 1 or other. ruby more need orm javascript is.

note, however, reason not "more accuracy". fp , integer operations return exact same results integer operands. fp has 52 bits, , although that's greater standard 32-bit int it's less also-common 64-bit long or long long, no 1 wins or loses on precision. both accurate.

and yes, jörg hints, integer ops more extended greater precision.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -