|
Dynamic Fraction Library 1.0.0
Reference-counted arbitrary precision rational number library (MIT OR Unlicense)
|
Functions for converting to/from other types. More...
Functions | |
| double | df_to_double (df_frac f) |
| Convert to double. | |
| bool | df_to_int64 (df_frac f, int64_t *result) |
| Convert to int64_t if possible. | |
| char * | df_to_string (df_frac f) |
| Convert to string. | |
| df_frac | df_from_string (const char *str) |
| Parse fraction from string. | |
| di_int | df_numerator (df_frac f) |
| Get numerator as di_int. | |
| di_int | df_denominator (df_frac f) |
| Get denominator as di_int. | |
Functions for converting to/from other types.
Get denominator as di_int.
| f | Fraction |
Definition at line 1006 of file dynamic_fraction.h.
| df_frac df_from_string | ( | const char * | str | ) |
Parse fraction from string.
| str | String to parse (format: "num/den" or "num") |
Definition at line 954 of file dynamic_fraction.h.
Get numerator as di_int.
| f | Fraction |
Definition at line 1000 of file dynamic_fraction.h.
| double df_to_double | ( | df_frac | f | ) |
Convert to double.
| f | Fraction to convert |
Definition at line 904 of file dynamic_fraction.h.
| bool df_to_int64 | ( | df_frac | f, |
| int64_t * | result | ||
| ) |
Convert to int64_t if possible.
| f | Fraction to convert |
| result | Pointer to store result |
Definition at line 914 of file dynamic_fraction.h.
| char * df_to_string | ( | df_frac | f | ) |
Convert to string.
| f | Fraction to convert |
Definition at line 923 of file dynamic_fraction.h.