A bug or I'm blind ?

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

A bug or I'm blind ?

Post by D.J.Peters »

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: 205
Joined: May 27, 2005 5:22
Location: Earth
Contact:

Re: A bug or I'm blind ?

Post by Plasma »

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

Re: A bug or I'm blind ?

Post by fxm »

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: 6323
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Re: A bug or I'm blind ?

Post by counting_pine »

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