File: main_ref.cpp

package info (click to toggle)
fast-float 8.0.0-0.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 872 kB
  • sloc: cpp: 6,819; ansic: 3,414; python: 366; sh: 37; makefile: 8
file content (16 lines) | stat: -rw-r--r-- 338 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "fast_float/fast_float.h"

double get(char const *input) {
  double result_value;
  auto result =
      fast_float::from_chars(input, input + strlen(input), result_value);
  if (result.ec != std::errc()) {
    return 10;
  }
  return result_value;
}

int main(int arg, char **argv) {
  double x = get(argv[0]);
  return int(x);
}