this repo has no description
at trunk 29 lines 684 B view raw
1/* Copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com) */ 2#pragma once 3 4#include "globals.h" 5#include "handles.h" 6#include "objects.h" 7 8namespace py { 9 10class Thread; 11 12word doubleHash(double value); 13 14word floatHash(RawObject value); 15 16// Read ASCII digits from str and make a float from those digits. 17RawObject floatFromDigits(Thread* thread, const char* str, word length); 18 19void initializeFloatType(Thread* thread); 20 21RawObject intFromDouble(Thread* thread, double value); 22 23void decodeDouble(double value, bool* is_neg, int* exp, int64_t* mantissa); 24 25inline word floatHash(RawObject value) { 26 return doubleHash(Float::cast(value).value()); 27} 28 29} // namespace py