Alguien me puede hechar una mano con lo siguiente :
En VB :
Dim resultValue As Integer
resultValue = 11 \ 4
resultValue = 9 \ 3
resultValue = 100 \ 3
resultValue = 67 \ -3
!! OJO CON EL OPERADOR " \ "
Divide dos números y devuelve un resultado de número entero.
en el ejemplo anterior devuelven valores de 2, 3, 33 y -22
Cual seria su equivalente en XHarbour ?.
Por su atencion Gracias.
Ricardo E. Guardado Flores.
Dudas con Operadores
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Maestro:
No debería ser así ?
resultValue = Int( 11 / 4 )
resultValue = Int( 9 / 3 )
resultValue = Int( 100 / 3 )
resultValue = Int( 67 / -3 )
Saludos
No debería ser así ?
resultValue = Int( 11 / 4 )
resultValue = Int( 9 / 3 )
resultValue = Int( 100 / 3 )
resultValue = Int( 67 / -3 )
Saludos
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Asi es, Estaba aplicando la funcion INT(x/i......)
Pero el resultado no era el mismo que VB asi que por eso mi pregunta.
Entonces:
VB
xNumber = (((37 + _
((512 - 448) \ 8)) \ _
(512 \ 8) + 1) * _
(512 \ 32))
EL valor de xNumber es 16 (Segun el Debugger de VB )
XHB
xNumber := Int( ((( 37 + ;
( Int( ( 512 - 448) / 8)) ) / ;
( Int( 512 / 8)) ) + 1) * ;
( Int( 512 / 32)) )
EL valor de xNumber es 27
Estoy aplicando mal la funcion INT(.....) ????????????????????????'
Ricardo E. Guardado Flores
Pero el resultado no era el mismo que VB asi que por eso mi pregunta.
Entonces:
VB
xNumber = (((37 + _
((512 - 448) \ 8)) \ _
(512 \ 8) + 1) * _
(512 \ 32))
EL valor de xNumber es 16 (Segun el Debugger de VB )
XHB
xNumber := Int( ((( 37 + ;
( Int( ( 512 - 448) / 8)) ) / ;
( Int( 512 / 8)) ) + 1) * ;
( Int( 512 / 32)) )
EL valor de xNumber es 27
Estoy aplicando mal la funcion INT(.....) ????????????????????????'
Ricardo E. Guardado Flores