1

Existe t-il un format pour la fonction sprintf qui permet de convertir un nombre en un nombre à virgule

ex: dc.l 12345678 -> "1234.5678"

J'ai déjà essayé ça, mais je dois séparer le nombre en 2 words avant:

move.w #5678,-(sp)
move.w #1234,-(sp)
pea format(pc)
pea buffer(pc)
jsr tios::sprintf
lea 12(sp),sp

format dc.b "%u.%04u"
buffer ds.b 20

2

L'arithmétique flottante c'est over-compliqué sad
Kevin aura sûrement le courage de te donner des explications grin
avatar
Un site complet sur lequel vous trouverez des programmes et des jeux pour votre calculatrice TI 89 / Titanium / 92+ / Voyage 200 : www.ti-fr.com.
Quelques idées personnelles ici.

3

Au contraire, c'est hyper-facile ici. format dc.b "%f",0

Et lis http://tigcc.ticalc.org/doc/stdio.html#printf pour en savoir plus sur les formats à utiliser.
avatar
Mes news pour calculatrices TI: Ti-Gen
Mes projets PC pour calculatrices TI: TIGCC, CalcForge (CalcForgeLP, Emu-TIGCC)
Mes chans IRC: #tigcc et #inspired sur irc.freequest.net (UTF-8)

Liberté, Égalité, Fraternité

4

Par contre, le format de ton float sur la pile ne va pas du tout!
C'est:
 move.l #$40031234,-(sp)
 move.l #$56780000,-(sp)
 clr.w -(sp)
 pea format(pc) 
 pea buffer(pc) 
 move.l $c8,a0
 move.l sprintf*4(a0),a0
 jsr (a0)
;(pourquoi utiliser le mode kernel?)
 lea 18(sp),sp

format dc.b "%f",0
buffer ds.b 26 ;minimum pour pouvoir représenter tous les floats


Cf. http://tigcc.ticalc.org/doc/asminfo.html et http://tigcc.ticalc.org/doc/timath.html#bcd.
[edit]Edité par Kevin Kofler le 30-12-2001 à 03:26:46[/edit]
avatar
Mes news pour calculatrices TI: Ti-Gen
Mes projets PC pour calculatrices TI: TIGCC, CalcForge (CalcForgeLP, Emu-TIGCC)
Mes chans IRC: #tigcc et #inspired sur irc.freequest.net (UTF-8)

Liberté, Égalité, Fraternité

5

Pour garder ton format, tu dois diviser le nombre par 10000 avec divu (cf. le 68kguide), et donnner quotient et reste à sprintf.
avatar
Mes news pour calculatrices TI: Ti-Gen
Mes projets PC pour calculatrices TI: TIGCC, CalcForge (CalcForgeLP, Emu-TIGCC)
Mes chans IRC: #tigcc et #inspired sur irc.freequest.net (UTF-8)

Liberté, Égalité, Fraternité

6

> Kevin ";(pourquoi utiliser le mode kernel?)"
C'est vrai, pourquoi ? wink

7

Parce son programme est en kernel !

8

Donc reposons la question autrement: Pourquoi son programme est-il en kernel?
avatar
Mes news pour calculatrices TI: Ti-Gen
Mes projets PC pour calculatrices TI: TIGCC, CalcForge (CalcForgeLP, Emu-TIGCC)
Mes chans IRC: #tigcc et #inspired sur irc.freequest.net (UTF-8)

Liberté, Égalité, Fraternité

9

et c reparti sur c egd débat grin
qd c po Alizée, c Kernel vs Nostub grin
avatar
Tutorial C (TI-89/92+/v200) - Articles Développement Web (PHP, Javascript, ...)
« What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against? » - Larry Wall

10

LOL. grin
avatar
Mes news pour calculatrices TI: Ti-Gen
Mes projets PC pour calculatrices TI: TIGCC, CalcForge (CalcForgeLP, Emu-TIGCC)
Mes chans IRC: #tigcc et #inspired sur irc.freequest.net (UTF-8)

Liberté, Égalité, Fraternité

11

Alizée est connue aux USA, Kevin ?

12

je penses po, mais bon, qui sait...
avatar
Tutorial C (TI-89/92+/v200) - Articles Développement Web (PHP, Javascript, ...)
« What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against? » - Larry Wall

13

ici c pas connu...


Prise de tête: PhD dans la mire.

------------------------------------------------------------------------------------
Mon site TI 83+ et 83+SE (mort)
Le forum TI 83+ de yAronet !!! (rattaché au site..)

14

deja qu'en france, on la vois plus (TANT MIEUX PUTAIN !) alors a part chez les allemands , je crois que c tout ...
"I read the game.dll assembly more easily than you read the joke on the back of your box of Cocoa Pebbles, and have spent the past 2 1/2 years navigating it." ©

15

...
[edit]Edité par Renorems le 11-01-2002 à 22:01:58[/edit]

16

PUTAIN DE BORDEL, PETIT PD, SI JAMAIS JE TE CHOPE!!vtff
In many respects the Yoshi is like a beautiful woman. A man can come so enamoured that he bestows on her all his time, his energy and his fortune.
- Fred whipple, 1960

*** Ne sous-estimez pas la puissance de la Marmotte ***
© Marmotte Team : LaMarmotte, sBibi, Vark & Sabrina

17

c clur
on est pas que 2 à le penser
:D