Bonjour,
Je viens de débuter en Julia 1.1.0 sous Manjaro en suivant l'excellent tutoriel Intro to Julia fourni par julialang.org.
Dans le notebook 10.1 Multiple Dispatch sous jupyter, non couvert dans la vidéo, on exploite les chiffres Romains.
Le code suivant :
Code:
1
2
3
4
5
6 struct Roman n::Int end Base.show(io::IO, r::Roman) = print(io, 'i', i + (r.n - 1) % 10) # nice display;
Ensuite on exécute :
Code:
1
2 Roman(4)
Et il s'affiche :
Comment est-ce possible? D'où sort la lettre v?Citation:
iv
En refaisant la même manipulation en julia console, j'obtiens :
Ce qui est plus logique car trois lettres après i, on a bien l.Citation:
l
Merci d'avance.