Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

#1 2015-10-07 21:41:39

Crona
Member
From: Wisconsin
Registered: 2014-09-23
Posts: 58
Website

GBDK doesnt support math.h ?!?

I'm working on this project and I needed to use floor() but it was saying that was an unrecognized thing, so I googled it and figured out that you needed to include math.h but when I include that the compiler says undocumented I/O error! How on earth have we gone this long without taking about the lack of a floor function!

Offline

 

#2 2015-10-08 12:05:06

Xephyr
Member
From: France
Registered: 2015-02-26
Posts: 59

Re: GBDK doesnt support math.h ?!?

GBDK does not completly use basic C functions. For printf() for exemple, it's a function coded directly to work on the GameBoy and not the one you would usually have with stdio.h in a classic C program.
The same way, if you want to use the floor() function, you'll have to rewrite your own one that compile with GBDK.

Offline

 

#3 2015-10-09 17:25:52

a cat
Member
Registered: 2014-07-27
Posts: 98

Re: GBDK doesnt support math.h ?!?

i looked for a while on the internet and this was the best thing i could find to help you implement a floor(); function
unless you want to search through the hole glib library!

https://stackoverflow.com/questions/745 … om-scratch

Last edited by a cat (2015-10-09 17:25:58)


a cat in need of knowledge!!

Offline

 

#4 2015-10-10 15:16:27

Scazon
Member
From: Boston, MA
Registered: 2015-06-14
Posts: 24
Website

Re: GBDK doesnt support math.h ?!?

What use is floor() when gbdk doesn't support floats?

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson