diff options
| author | Julian Weigt <juw@posteo.de> | 2025-12-23 15:55:51 +0000 |
|---|---|---|
| committer | Julian Weigt <juw@posteo.de> | 2026-02-04 15:55:45 +0100 |
| commit | edcded21cbeb272ff206a92c693ab21bf33ebae6 (patch) | |
| tree | 5f6e0f2a73bae9644619e8b40ec99895ee3f68ff /ratio.h | |
| parent | 470b14ac5e1a852ad36a9fd7ff580aaab7d23053 (diff) | |
Define safe sums and products and finish exact version.
Diffstat (limited to 'ratio.h')
| -rw-r--r-- | ratio.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -2,7 +2,7 @@ #include <stdlib.h> #include <math.h> -typedef struct {long int n; long unsigned int d}rational; +typedef struct {bool s; unsigned long long n; unsigned long long d}rational; rational convert_int(int); @@ -20,4 +20,7 @@ rational absolute(rational); rational power(rational,unsigned int); + double to_double(rational); + +bool to_string(char*,rational r); |
