找回密码
 加入
搜索
查看: 4591|回复: 4

[AU3基础] 大于XX 小于XX 的数怎么判断呢! 比较好奇哈!

[复制链接]
发表于 2013-9-6 01:44:21 | 显示全部楼层 |阅读模式
$i=-2
If  -1 < $i < 5  Then MsgBox(0, '',123)
这样子不行

一定要这样子
$i=1
If  -1 < $i And $i< 5  Then MsgBox(0, '',123)
还有其他表示方法吗?
比较好奇 看看有其他表示的方法不!
发表于 2013-9-6 08:34:57 | 显示全部楼层
#Include <Math.au3>
_IsBound( $nNumber[, $nUbound[, $nLbound]] )
 楼主| 发表于 2013-9-6 18:02:39 | 显示全部楼层
#Include
_IsBound( $nNumber[, $nUbound[, $nLbound]] )
netegg 发表于 2013-9-6 08:34
#include-once

; #INDEX# =======================================================================================================================
; Title .........: Mathematical calculations
; AutoIt Version : 3.0
; Language ......: English
; Description ...: Functions that assist with mathematical calculations.
; Author(s) .....: Valik, Gary Frost, ...
; ===============================================================================================================================

; #CURRENT# =====================================================================================================================
; _Degree
; _MathCheckDiv
; _Max
; _Min
; _Radian
; ===============================================================================================================================

; #FUNCTION# ====================================================================================================================
; Author ........: Erifash <erifash at gmail dot com>
; ===============================================================================================================================
Func _Degree($iRadians)
        If IsNumber($iRadians) Then Return $iRadians * 57.2957795130823
        Return SetError(1, 0, "")
EndFunc   ;==>_Degree

; #FUNCTION# ====================================================================================================================
; Author ........:  Wes Wolfe-Wolvereness <Weswolf at aol dot com>
; ===============================================================================================================================
Func _MathCheckDiv($iNum1, $iNum2 = 2)
        If Number($iNum1) = 0 Or Number($iNum2) = 0 Or Int($iNum1) <> $iNum1 Or Int($iNum2) <> $iNum2 Then
                Return SetError(1, 0, -1)
        ElseIf Int($iNum1 / $iNum2) <> $iNum1 / $iNum2 Then
                Return 1
        Else
                Return 2
        EndIf
EndFunc   ;==>_MathCheckDiv

; #FUNCTION# ====================================================================================================================
; Author ........: Jeremy Landes <jlandes at landeserve dot com>
; Modified ......: guinness - Added ternary operator.
; ===============================================================================================================================
Func _Max($iNum1, $iNum2)
        ; Check to see if the parameters are numbers
        If Not IsNumber($iNum1) Then Return SetError(1, 0, 0)
        If Not IsNumber($iNum2) Then Return SetError(2, 0, 0)
        Return ($iNum1 > $iNum2) ? $iNum1 : $iNum2
EndFunc   ;==>_Max

; #FUNCTION# ====================================================================================================================
; Author ........: Jeremy Landes <jlandes at landeserve dot com>
; Modified ......: guinness - Added ternary operator.
; ===============================================================================================================================
Func _Min($iNum1, $iNum2)
        ; Check to see if the parameters are numbers
        If Not IsNumber($iNum1) Then Return SetError(1, 0, 0)
        If Not IsNumber($iNum2) Then Return SetError(2, 0, 0)
        Return ($iNum1 > $iNum2) ? $iNum2 : $iNum1
EndFunc   ;==>_Min

; #FUNCTION# ====================================================================================================================
; Author ........: Erifash <erifash at gmail dot com>
; ===============================================================================================================================
Func _Radian($iDegrees)
        If Number($iDegrees) Then Return $iDegrees / 57.2957795130823
        Return SetError(1, 0, "")
EndFunc   ;==>_Radian
没你发的这个参数貌似!
发表于 2013-9-8 08:05:37 | 显示全部楼层
exe的帮助里有替换下原始的math.au3
发表于 2013-9-11 08:57:16 | 显示全部楼层
你的数学思维太严重了,不要把数学上的写法和日常中的写法带到程序中来。任何语言都有其规则,改变自己的思维去适应规则。
$i=1
If  $i>-1 And $i< 5  Then MsgBox(0, '',123)
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-10-6 14:30 , Processed in 0.073630 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表