[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Re: Integer Calculation
From: |
w . gertzen |
Subject: |
Re: Re: Integer Calculation |
Date: |
Fri, 28 Jun 2002 11:00:35 +0200 (CEST) |
Hi !
Thanks to Paul Kienzle for his hint !
But there one new question about integer arithmetic.
For unsigned values I need a operation which does 0x0000 - 1 = 0xffff
(16Bit)
Is there no way to define a 16Bit (or 32Bit) signed/unsigned Variable
?????
Wolfgang
>Paul Kienzle wrote:
>
>Try:
>
> fix(2/3)
> fix(4/3)
> rem(0xffff+1,0x10000)
> rem(0xffff+1,0x100000000)
>
>Paul Kienzle
>address@hidden
>> On Wed, Jun 26, 2002 at 10:09:40AM -0500, address@hidden
wrote:
>> Hi !
>> I try to use Octave to simulate a velocity controller.
>> This controller software normaly runs on a 68040 based
>> board.
>> The controller made use of 16Bit and 32Bit values
>> wich can be signed or unsigned.
>> So when I try to simulate the velocity controller
>> I have the problem that Octave can't handle 16/32Bit Integer
>> arithmetik.
>> Examples (what I need):
>> 2/3 = 0
>> 4/3 = 1
>> 0xffff + 1 = 0 ! (16Bit Value)
>> 0x0000ffff + 1 = 0x00010000 ! (32Bit Value)
>> So for some variables I didn't want to use a float value !!
>> Or is it impossible because every variable inside octave is a flot
>> value ?
>> Thanks
>> Wolfgang
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------