Nimony

The road to Nim 3

frexp

nimony/lib/std/math/frexp.nim

Freestanding (nimNativeIo, libc-free) implementations of signbit, classify, isNaN and frexp, operating directly on IEEE-754 bit patterns. The normal-value frexp bit manipulation follows Rust compiler-builtins/libm's generic/frexp.rs and FreeBSD/SunPro fdlibm's s_frexp.c; subnormals use a Nimony-specific pure-Nim scaling/recursion path instead of Rust's bit normalization. Classification and sign tests implement the IEEE-754 binary32/binary64 field definitions and the C fpclassify/signbit/isnan contracts. Sources: FreeBSD /usr/src/lib/msun/src/s_frexp.c; Rust library/compiler-builtins/libm/src/math/generic/frexp.rs. Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. Copyright (c) 2018 Jorge Aparicio (Rust compiler-builtins/libm). Developed at SunPro, a Sun Microsystems, Inc. business. Permission to use, copy, modify, and distribute this software is freely granted, provided that this notice is preserved.