scientific.e was written by Matt Lewis (matthewwalkerlewis@gmail.com)
It's purpose is to parse numbers in scientific notation to the maximum precision allowed by the IEEE 754 floating point standard.
LICENSE AND DISCLAIMER
The MIT License Copyright (c) 2007 Matt Lewis Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Topic | Description |
Index | Alphabetical list of all items. |
Low level | Helper routines |
Scientific Notation | Parsing routines |
1e0 3.1415e-2 -9.0E+3
This doesn't mean that if the 17th digit is 5 or higher, you should include it. The calculations are much more complicated, because a decimal fraction has to be converted to a binary fraction, and there's not really a one-to-one correspondence between the decimal digits and the bits in the resulting atom. The 18th or higher digit, however, will never have an effect on the resulting atom.
The biggest and smallest (magnitude) atoms possible are:
1.7976931348623157e+308 4.9406564584124654e-324
Takes a sequence of bits (all elements either 0 or 1) and converts it into a sequence of bytes.
See Also: bytes_to_bits
Converts a sequence of bytes (all elements integers between 0 and 255) and converts it into a sequence of bits.
See Also: bits_to_bytes
Takes a string reprepresentation of a number in scientific notation and returns an atom.
See Also: scientific_to_float64
Takes a string reprepresentation of a number in scientific notation and returns a sequence of bytes in the raw format of an IEEE 754 double precision floating point number. This value can be passed to the euphoria library function, float64_to_atom().
See Also: scientific_to_atom
func
] func
]
] func
] func
]