Category "floating-point"

Why wasn't a specifier for `float` defined in `printf`?

It looks like it could have been, there are (at least in C99) length modifiers that can be applied to int: %hhd, %hd, %ld and %lld mean signed char, short, long

Significant digits with IEEE 754 float

The Wiki Double-precision floating-point format says: This gives 15–17 significant decimal digits precision. If a decimal string with at most 15 signific

Why are numbers with many significant digits handled differently in C# and JavaScript?

If JavaScript's Number and C#'s double are specified the same (IEEE 754), why are numbers with many significant digits handled differently? var x = (long)123412

Why is printf round floating point numbers up?

I am trying to print some floating point numbers using printf. For example: int main() { printf("%.1f",76.75); return 0; } Output: 76.8 And I have som

Is there a functional difference between "2.00" and "2.00f"?

I ask because I am using the Box2D library, which calls for mostly float arguments. Although I see a lot of example code that uses the 0.00f format, I am not qu

Does single floating point operation calculated at higher precision and immediately truncated always produce identical result?

Does single floating point operation (like a+b, a-b, a*b or a/b) calculated at higher precision (80 bits) and immediately truncated (to 32 bits) always produce

Algorithm for pow(float, float)

I need an efficent algorithm to do math::power function between two floats, do you have any idea how to do this, (i need the algorithm not to use the function

Getting maximum value of float in SQL programmatically

Is there an method for programmatically (in T-SQL) retrieving the maximum (and minimum) value of a datatype? That it would act like float.MaxValue in C#. I wou

Getting maximum value of float in SQL programmatically

Is there an method for programmatically (in T-SQL) retrieving the maximum (and minimum) value of a datatype? That it would act like float.MaxValue in C#. I wou

Getting maximum value of float in SQL programmatically

Is there an method for programmatically (in T-SQL) retrieving the maximum (and minimum) value of a datatype? That it would act like float.MaxValue in C#. I wou

Getting maximum value of float in SQL programmatically

Is there an method for programmatically (in T-SQL) retrieving the maximum (and minimum) value of a datatype? That it would act like float.MaxValue in C#. I wou