Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: quick question for predefined TTCN-3 functions

quick question for predefined TTCN-3 functions 20 Mar 2003 15:29 #6436

Hi all,

Section C.1 states that 'int2char(integer value) return char' shall
"return -1 if the value of the argument is a negative or grater than 127".

Any idea how a char can be -1?

BR,

Theo
The administrator has disabled public write access.

quick question for predefined TTCN-3 functions 20 Mar 2003 15:37 #6437

Nicely spotted, Theo. Of course, this cannot be. In my opinion, this invalid argument is a test case error, and should be handled as such.

BR

Stephan

>
Original Message
> From: ext Theofanis Vassiliou-Gioles [This email address is being protected from spambots. You need JavaScript enabled to view it.]
> Sent: 20. March 2003 16:30
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: quick question for predefined TTCN-3 functions
>
>
> Hi all,
>
> Section C.1 states that 'int2char(integer value) return char' shall
> "return -1 if the value of the argument is a negative or
> grater than 127".
>
> Any idea how a char can be -1?
>
> BR,
>
> Theo
>
The administrator has disabled public write access.

quick question for predefined TTCN-3 functions 20 Mar 2003 16:07 #6438

In einer eMail vom 3/20/03 4:34:17 PM W. Europe Standard Time schreibt
This email address is being protected from spambots. You need JavaScript enabled to view it.:


>
> Section C.1 states that 'int2char(integer value) return char' shall
> "return -1 if the value of the argument is a negative or grater than 127".
>
> Any idea how a char can be -1?
>

It can't. That is an error.

Cheers,

Claude.

PS: maybe someone is assuming that char is represented by a two's complement
integer. :-). Still wrong though.

Conformance Technologies Ltd. email: This email address is being protected from spambots. You need JavaScript enabled to view it.
685 Cedar Point Road phone: +1 705 533 23 94
Penetanguishene, Ontario
Canada
L9M 1R3

Solonplatz 3 phone: +49 30 9606 7986
13088 Berlin
Germany
The administrator has disabled public write access.

quick question for predefined TTCN-3 functions 20 Mar 2003 16:24 #6439

Well, the non-serious answer is:

It depends on the integer representation of your computer

* 8-bit (B-1)-complement representation

-1 is represented as 1 1 1 1 1 1 1 0

* 8-bit B-complement representation

-1 is represented as 1 1 1 1 1 1 1 1

and now you can look into your ASCII-table for the
corresponding character.

The serious answer/suggestion is: Please write a CR!

Regards
Jens


Theofanis Vassiliou-Gioles schrieb:
>
> Hi all,
>
> Section C.1 states that 'int2char(integer value) return char' shall
> "return -1 if the value of the argument is a negative or grater than 127".
>
> Any idea how a char can be -1?
>
> BR,
>
> Theo

--

======================================================================
Dr. Jens Grabowski
Institute for Telematics phone: +49 451 500 3723
University of Luebeck fax: +49 451 500 3722
Ratzeburger Allee 160 eMail: This email address is being protected from spambots. You need JavaScript enabled to view it.
D-23538 Luebeck or This email address is being protected from spambots. You need JavaScript enabled to view it.
(Germany) WWW: www.itm.mu-luebeck.de
======================================================================
The administrator has disabled public write access.

quick question for predefined TTCN-3 functions 20 Mar 2003 19:28 #6440

In einer eMail vom 3/20/03 5:42:32 PM W. Europe Standard Time schreibt
This email address is being protected from spambots. You need JavaScript enabled to view it.:


Hi Jens,

Hey, I thought that TTCN-3 was supposed to be abstract and platform
independent!?! :-)

Cheers,

Claude.


> Well, the non-serious answer is:
>
> It depends on the integer representation of your computer
>
> * 8-bit (B-1)-complement representation
>
> -1 is represented as 1 1 1 1 1 1 1 0
>
> * 8-bit B-complement representation
>
> -1 is represented as 1 1 1 1 1 1 1 1
>
> and now you can look into your ASCII-table for the
> corresponding character.
>
> The serious answer/suggestion is: Please write a CR!


Conformance Technologies Ltd. email: This email address is being protected from spambots. You need JavaScript enabled to view it.
685 Cedar Point Road phone: +1 705 533 23 94
Penetanguishene, Ontario
Canada
L9M 1R3

Solonplatz 3 phone: +49 30 9606 7986
13088 Berlin
Germany
The administrator has disabled public write access.
  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin