Harbour and floats

Harbour and floats

Postby dissonantdev » Sat Jan 27, 2018 4:13 am

Hello! I'm new here so I hope you guys can lend me a hand if at all possible.

First I should disclose that I know pretty much nothing about Harbour, however I recently became interested in learning about it; so my question might already have an obvious answer!

For those of you that know, how does Harbour represent floats? Does it have any kind of limited-precision or arbitrary-precision decimal type?
I need something either like the limited precision decimal type in C# or something with arbitrary precision like Java's BigDecimal.

I personally use gmplib in C++, can that be used with Harbour?
GMP is a C library, and I think I heard in passing that Harbour can import and use C stuff; anyone that knows?

And last question! I recently found (10 minutes ago) Alexander Kresin's Harbour manual, but I thought I'd ask anyway.
Are there any other recommended resources to learn a bit more about the language?

Thank you for your time!
dissonantdev
 
Posts: 2
Joined: Thu Jan 25, 2018 8:06 pm

Re: Harbour and floats

Postby Rick Lipkin » Sat Jan 27, 2018 2:18 pm

Welcome to the forum .. here is the ( new ) Harbour website .. a good place to start .. documentation, downloads, reference guides and code samples .. enjoy!

Rick Lipkin

https://harbour.github.io/
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Harbour and floats

Postby cnavarro » Sat Jan 27, 2018 8:40 pm

Hello
Welcome to the forum
I am sure that among all the companions we can help you in all the doubts you have
Please, read
viewtopic.php?f=3&t=19688#p103823
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6548
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Harbour and floats

Postby Antonio Linares » Sun Jan 28, 2018 6:14 am

1)
https://groups.google.com/forum/#!searchin/harbour-devel/float%7Csort:date
https://groups.google.com/forum/#!searchin/harbour-devel/double%7Csort:date

In hbapi.h:
#define HB_IT_DOUBLE 0x00010
Code: Select all  Expand view
struct hb_struDouble
{
   double value;
   HB_USHORT length;
   HB_USHORT decimal;
};

Search for double in hbapi.h and review all related doubles functions
You may also review hbfloat.h

2) You can use any C library from Harbour:
viewtopic.php?p=63612#p63612
viewtopic.php?p=66183#p66183
viewtopic.php?p=96883#p96883
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Harbour and floats

Postby dissonantdev » Mon Jan 29, 2018 2:06 am

I just had enough time to check all those resources you guys linked, thank you very much!
It's exactly what I was looking for.

Thanks again for all the help!
dissonantdev
 
Posts: 2
Joined: Thu Jan 25, 2018 8:06 pm


Return to Off Topic / Otros temas

Who is online

Users browsing this forum: No registered users and 8 guests