A bug or I'm blind ?

General FreeBASIC programming questions.
D.J.Peters
Posts: 8240
Joined: May 28, 2005 3:28
Contact:

A bug or I'm blind ?

Postby D.J.Peters » Feb 20, 2017 2:42

Why is -.5 not allowed in this case ?

Joshy

Code: Select all

type real as single
type v3
  as real x,y,z
end type
type v2
  as real u,v
end type
type VERTEX
  as V3 p
  as V3 n
  as V2 t
end type

dim as VERTEX v0,v1,v2
 
v0=type<VERTEX>(   0,1,0,  0,0,-1,   0,0)  ' ok
v1=type<VERTEX>( -.5,0,0,  0,0,-1,   0,1)  ' error
v2=type<VERTEX>((-.5,0,0),(0,0,-1), (0,1)) ' ok
sleep
Plasma
Posts: 191
Joined: May 27, 2005 5:22
Location: Earth
Contact:

Re: A bug or I'm blind ?

Postby Plasma » Feb 20, 2017 11:02

Does -0.5 work?
fxm
Posts: 10263
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: A bug or I'm blind ?

Postby fxm » Feb 20, 2017 12:47

At least, the third expression best reflecting the Type structure works!
That is already a shortcut allowed by the parser compared to:

Code: Select all

v2 = type<VERTEX>(type<V3>(-.5,0,0), type<V3>(0,0,-1), type<V2>(0,1))
counting_pine
Site Admin
Posts: 6246
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Re: A bug or I'm blind ?

Postby counting_pine » Feb 20, 2017 13:57

Do .5, 0.5, +/-5, +/-5.0 work? (Is it the '-', the leading dot, or the floating-point number?)

Return to “General”

Who is online

Users browsing this forum: No registered users and 4 guests