dconv 1.0
C++14 library for printing and parsing floating point numbers
Loading...
Searching...
No Matches
dconv Namespace Reference

Namespaces

namespace  details
 

Classes

class  DiyFp
 hand made floating point. More...
 
class  View
 char array view. More...
 

Functions

const char * atod (const char *str, double &value)
 string to double conversion.
 
const char * atod (const char *str, size_t length, double &value)
 string to double conversion.
 
const char * atod (const char *first, const char *last, double &value)
 string to double conversion.
 
constexpr DiyFp operator- (const DiyFp &lhs, const DiyFp &rhs)
 minus operator
 
constexpr DiyFp operator* (const DiyFp &lhs, const DiyFp &rhs)
 multiplication operator.
 
char * dtoa (char *buffer, double value)
 double to string conversion.
 

Detailed Description

MIT License

Copyright (c) 2021 Mathieu Rabine

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Copyright (c) 2025 Mathieu Rabine

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Function Documentation

◆ atod() [1/3]

const char * dconv::atod ( const char * first,
const char * last,
double & value )
inline

string to double conversion.

Parameters
firststring first position.
laststring last position.
valueconverted value.
Returns
end position on success, nullptr on failure.

◆ atod() [2/3]

const char * dconv::atod ( const char * str,
double & value )
inline

string to double conversion.

Parameters
strstring to parse.
valueconverted value.
Returns
end position on success, nullptr on failure.

◆ atod() [3/3]

const char * dconv::atod ( const char * str,
size_t length,
double & value )
inline

string to double conversion.

Parameters
strstring to parse.
lengthstring length.
valueconverted value.
Returns
end position on success, nullptr on failure.

◆ dtoa()

char * dconv::dtoa ( char * buffer,
double value )
inline

double to string conversion.

Parameters
bufferbuffer to write the string representation to.
valuevalue to convert.
Returns
end position.

◆ operator*()

DiyFp dconv::operator* ( const DiyFp & lhs,
const DiyFp & rhs )
inlineconstexpr

multiplication operator.

Parameters
lhsfloating point.
rhsfloating point.
Returns
a floating point from lhs multiplied by rhs.

◆ operator-()

DiyFp dconv::operator- ( const DiyFp & lhs,
const DiyFp & rhs )
inlineconstexpr

minus operator

Parameters
lhsfloating point.
rhsfloating point.
Returns
a floating point from lhs minus rhs.