Blame tests/test_float.c

Packit Service def718
/* Copyright (C) 2016 by Rainer Gerhards 
Packit Service def718
 * Released under ASL 2.0 */
Packit Service def718
#include "config.h"
Packit Service def718
#include <stdio.h>
Packit Service def718
#include "../json_object.h"
Packit Service def718
#include "../json_tokener.h"
Packit Service def718
int main(void)
Packit Service def718
{
Packit Service def718
  json_object *json;
Packit Service def718
Packit Service def718
  json = json_object_new_double(1.0);
Packit Service def718
  printf("json = %s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY));
Packit Service def718
  json_object_put(json);
Packit Service def718
  json = json_object_new_double(1.23);
Packit Service def718
  printf("json = %s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY));
Packit Service def718
  json_object_put(json);
Packit Service def718
  json = json_object_new_double(123456789.0);
Packit Service def718
  printf("json = %s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY));
Packit Service def718
  json_object_put(json);
Packit Service def718
  json = json_object_new_double(123456789.123);
Packit Service def718
  printf("json = %s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY));
Packit Service def718
  json_object_put(json);
Packit Service def718
  return 0;
Packit Service def718
}