Message: strange behaviour for "deg" unit Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None strange behaviour for "deg" unit 

Forum: Analysis
Date: 11 Aug, 2010
From: <ungaro@jlab.org>

Dear G4ers,

consider these 3 lines:

	G4double arg_theta = 30.0*deg;
	G4int theta_slider_pos = 20.0*(arg_theta/deg);
	cout <<  20*arg_theta/deg  << " " << theta_slider_pos << endl;

Normally we'd expect this to output "600 600". However it outputs "600 599".

If I use any other units, I get the normal result - so this is an "angles" problem, considering also that it only happens for the numbers "30, 60, 120", etc

It's a small effect, but it would be nice to fix it.

sincerely, mauri

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: strange behaviour for "deg" unit   (Michael H. Kelsey - 11 Aug, 2010)
 Add Message Add Message
to: "strange behaviour for "deg" unit"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]