Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
0dbd1fd4
Kaydet (Commit)
0dbd1fd4
authored
Agu 10, 1995
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
correct description of integer division; describe optional read arg
üst
3e43d838
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
16 deletions
+22
-16
libtypes.tex
Doc/lib/libtypes.tex
+11
-8
libtypes.tex
Doc/libtypes.tex
+11
-8
No files found.
Doc/lib/libtypes.tex
Dosyayı görüntüle @
0dbd1fd4
...
@@ -215,9 +215,9 @@ Notes:
...
@@ -215,9 +215,9 @@ Notes:
\begin{description}
\begin{description}
\item
[(1)]
\item
[(1)]
For (plain or long) integer division, the result is an integer
; it
For (plain or long) integer division, the result is an integer
.
always truncates towards zero.
The result is always rounded towards minus infinity: 1/2 is 0,
% XXXJH integer division is better defined nowadays
(-1)/2 is -1, 1/(-2) is -1, and (-1)/(-2) is 0.
\indexii
{
integer
}{
division
}
\indexii
{
integer
}{
division
}
\indexiii
{
long
}{
integer
}{
division
}
\indexiii
{
long
}{
integer
}{
division
}
...
@@ -666,17 +666,17 @@ Files have the following methods:
...
@@ -666,17 +666,17 @@ Files have the following methods:
\code
{
0
}
.
\code
{
0
}
.
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
read
}{
size
}
\begin{funcdesc}
{
read
}{
\optional
{
size
}
}
Read at most
\var
{
size
}
bytes from the file (less if the read hits
Read at most
\var
{
size
}
bytes from the file (less if the read hits
\EOF
{}
or no more data is immediately available on a pipe, tty or
\EOF
{}
or no more data is immediately available on a pipe, tty or
similar device). If the
\var
{
size
}
argument is
omitted, read all
similar device). If the
\var
{
size
}
argument is
negative or omitted,
data until
\EOF
{}
is reached. The bytes are returned as a string
read all
data until
\EOF
{}
is reached. The bytes are returned as a string
object. An empty string is returned when
\EOF
{}
is encountered
object. An empty string is returned when
\EOF
{}
is encountered
immediately. (For certain files, like ttys, it makes sense to
immediately. (For certain files, like ttys, it makes sense to
continue reading after an
\EOF
{}
is hit.)
continue reading after an
\EOF
{}
is hit.)
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
readline
}
{
}
\begin{funcdesc}
{
readline
}
optional
{
size
}
}
Read one entire line from the file. A trailing newline character is
Read one entire line from the file. A trailing newline character is
kept in the string
%
kept in the string
%
\footnote
{
The advantage of leaving the newline on is that an empty string
\footnote
{
The advantage of leaving the newline on is that an empty string
...
@@ -686,7 +686,10 @@ Files have the following methods:
...
@@ -686,7 +686,10 @@ Files have the following methods:
you can tell whether the last line of a file ended in a newline
you can tell whether the last line of a file ended in a newline
or not (yes this happens!).
}
or not (yes this happens!).
}
(but may be absent when a file ends with an
(but may be absent when a file ends with an
incomplete line). An empty string is returned when
\EOF
{}
is hit
incomplete line). If thevar
{
size
}
argument is present and
non-negative, it is a maximum byte count (including the trailing
newline) and an incomplete line may be returned.
An empty string is returned when
\EOF
{}
is hit
immediately. Note: unlike
\code
{
stdio
}
's
\code
{
fgets()
}
, the returned
immediately. Note: unlike
\code
{
stdio
}
's
\code
{
fgets()
}
, the returned
string contains null characters (
\code
{
'
\e
0'
}
) if they occurred in the
string contains null characters (
\code
{
'
\e
0'
}
) if they occurred in the
input.
input.
...
...
Doc/libtypes.tex
Dosyayı görüntüle @
0dbd1fd4
...
@@ -215,9 +215,9 @@ Notes:
...
@@ -215,9 +215,9 @@ Notes:
\begin{description}
\begin{description}
\item
[(1)]
\item
[(1)]
For (plain or long) integer division, the result is an integer
; it
For (plain or long) integer division, the result is an integer
.
always truncates towards zero.
The result is always rounded towards minus infinity: 1/2 is 0,
% XXXJH integer division is better defined nowadays
(-1)/2 is -1, 1/(-2) is -1, and (-1)/(-2) is 0.
\indexii
{
integer
}{
division
}
\indexii
{
integer
}{
division
}
\indexiii
{
long
}{
integer
}{
division
}
\indexiii
{
long
}{
integer
}{
division
}
...
@@ -666,17 +666,17 @@ Files have the following methods:
...
@@ -666,17 +666,17 @@ Files have the following methods:
\code
{
0
}
.
\code
{
0
}
.
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
read
}{
size
}
\begin{funcdesc}
{
read
}{
\optional
{
size
}
}
Read at most
\var
{
size
}
bytes from the file (less if the read hits
Read at most
\var
{
size
}
bytes from the file (less if the read hits
\EOF
{}
or no more data is immediately available on a pipe, tty or
\EOF
{}
or no more data is immediately available on a pipe, tty or
similar device). If the
\var
{
size
}
argument is
omitted, read all
similar device). If the
\var
{
size
}
argument is
negative or omitted,
data until
\EOF
{}
is reached. The bytes are returned as a string
read all
data until
\EOF
{}
is reached. The bytes are returned as a string
object. An empty string is returned when
\EOF
{}
is encountered
object. An empty string is returned when
\EOF
{}
is encountered
immediately. (For certain files, like ttys, it makes sense to
immediately. (For certain files, like ttys, it makes sense to
continue reading after an
\EOF
{}
is hit.)
continue reading after an
\EOF
{}
is hit.)
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
readline
}
{
}
\begin{funcdesc}
{
readline
}
optional
{
size
}
}
Read one entire line from the file. A trailing newline character is
Read one entire line from the file. A trailing newline character is
kept in the string
%
kept in the string
%
\footnote
{
The advantage of leaving the newline on is that an empty string
\footnote
{
The advantage of leaving the newline on is that an empty string
...
@@ -686,7 +686,10 @@ Files have the following methods:
...
@@ -686,7 +686,10 @@ Files have the following methods:
you can tell whether the last line of a file ended in a newline
you can tell whether the last line of a file ended in a newline
or not (yes this happens!).
}
or not (yes this happens!).
}
(but may be absent when a file ends with an
(but may be absent when a file ends with an
incomplete line). An empty string is returned when
\EOF
{}
is hit
incomplete line). If thevar
{
size
}
argument is present and
non-negative, it is a maximum byte count (including the trailing
newline) and an incomplete line may be returned.
An empty string is returned when
\EOF
{}
is hit
immediately. Note: unlike
\code
{
stdio
}
's
\code
{
fgets()
}
, the returned
immediately. Note: unlike
\code
{
stdio
}
's
\code
{
fgets()
}
, the returned
string contains null characters (
\code
{
'
\e
0'
}
) if they occurred in the
string contains null characters (
\code
{
'
\e
0'
}
) if they occurred in the
input.
input.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment