Is there any way to work with decimals in Bash? Do operations, obviously. I've tried with let , but it always throws me an error with the decimal part.
Thank you very much.
I want to convert a string of 6 bytes in hexadecimal to a float
float desencapsularArchivo::hex2dec(string aConvertir)
{
int cantHex = aConvertir.size();
float decimal = 0;
for(int hexNum = 0;hexNum < cantHex; hexNum++)...
I wanted to know a simple way to convert a variable float or int in data type string in C++ . Because look in several places and talk about using sprintf , from the library stdio.h but it does not work w...
I need the program to accept only decimal numbers. The one I did is fine, only accepts decimals, but if you enter for example -23.45jdhsdj . The numbers if you save them, although you ignore the letters and it should not be like that.
Yo...
I have an operation that returns a float for example 6.3 and I need to round it to 7
I have tried with Math.round(6.3) but when the decimal is less than 0.5 it rounds down and when it is bigger it rounds up and I need it to...
I have a program that reads me file data excel and csv and writes them in txt .
The problem I have is that one of the columns that he reads are decimals and when writing them he puts them all as decimal. The issue is that I j...
I have this array (values string )
locations = [
{lat: "-31.563910", lng: "147.154312"},
{lat: "-33.718234", lng: "150.363181"},
{lat: "-33.727111", lng: "150.371124"}
]
and I want the array to be like this...
Good, I have this method done in Java and the result that returns is a number with many decimals, I would like some way for me to return two decimals only.
Code:
public static float calcularMedia(int[] notas)
{
float resultado =...
I'm using a priority queue consisting of a pair of an object of a class called Nodo and a value of type float (I chose it instead of double, thinking it takes up less bytes).
The error I get is in the comparison operator >...
I already saw the problem of floating comparisons with integers and decimals.
Here is explained in the red box:
link
To solve this we have the library: BCMath arbitrary precision math :
link
And supposedly the function would come from...