• if和whether的区别

    千次阅读 2010-07-18 20:20:00
    if和whether都可译为/"是否/",二者引导宾语从句时通常可以互相替换,口语中多用if代替whether。例如:Ask if/whether he plans to come to the meeting. 而以下几种情况中, 只能用whether: 1. 强调两...

    if和whether都可译为/"是否/",二者引导宾语从句时通常可以互相替换,口语中多用if代替whether。例如:Ask if/whether he plans to come to the meeting. 而以下几种情况中, 只能用whether:
    1. 强调两方面的选择,特别是句中有or not时。如:
    Let me know whether you can come or not.
    2. 宾语从句前置时。如:
    Whether this is true, I can/'t say.
    3. 引导主语、表语、同位语从句时。如:
    Whether the football game will be played depends on the weather. (主语从句)
    The question is whether he can do it. (表语从句)
    The question whether we should go with them must be decided at once. (同位语从句)

    4. 在介词之后作介词的宾语时。如:
    I haven/'t settled the question of whether I/'ll go back home.

    5. 在不定式前与不定式一起组成词组时。如:
    Whether to go or stay is still a question.

    6. 在discuss, decide 等动词后作宾语时。如:
    We discussed whether we should go there by plane.

    值得注意的是: if还可以引导条件状语从句,是/"假如;如果/"之意,而whether可以引导让步状语从句,是/"不管;无论/" 之意。如:
    If you ask him, he will help you.
    I shall go, whether you come with me or stay at home.

    一、if或whether引导宾语从句时,作“是否”讲,常放在动词ask 、see 、say 、know和find out等后面。一般情况下,两者常可换用,在口语中多用if。如:
    例1 Nobody knows whether (if) it will rain tomorrow. 没有人知道明天是否下雨。

    例2 Lucy asked whether (if) they had a cotton sweater .露西问他们是否有棉制的羊毛衣。

    1 if或whether不能和that 或其它连词(副词)同时使用,也不能省去。如:
    例3 我不知道他今天是否会来。

    [误] I don’t know that if(whether) he will come here today .
    [正] I don’t know if(whether) he will come here today .

    误] He came to see what if (whether) there was wrong with his cat .

    [正] He came to see if (whether) there was wrong with his cat .

    2 if或whether引导的宾语从句时,虽具有疑问意义,但从句语序应用陈述句语序。如:

    例5 Did you know the way to the hospital ? The old woman asked me .

    The old woman asked me .if (whether) I knew the way to the hospital .老妇人问我是否知道去医院的路。

    3 if或whether引导的宾语从句应和主句的时态保持一致。即主句为一般现在时,从句用任一种时态;主句为一般过去时,从句则用过去时中的任一种时态。如:

    例6 I don’t know if (whether) he has come here . 我不知道他是否来过这儿。

    例7 Tom asked if (whether) I had read the book . 汤姆问我是否看过这本书 。


    1 在动词不定式之前只能用whether 。如:

    例8 I can’t decide whether to stay. 我不能决定是否留下。

    2 在whether …… or not 的固定搭配中。如:

    例9 I want to know whether it’s good news or not . 我想知道是否是好消息。

    3 在介词后,只能用whether。如:

    例10 His father is worried about whether he lose his work . 他的父亲担心是否会失去工作。

    4宾语从句放在句首表示强调时,只能用whether 。如:

    例11 Whether they can finish the work on time is still a problem . 他们是否能准时完成这项工作还是个问题。


    例12 Could you tell me if you know the answer ?


  • // Returns whether the assertion was successful (true) or not (false). func InEpsilon(t TestingT, expected, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool { actualEpsilon, err :...
  • 原文http://www.wellho.net/mouth/985_Equality-in-Ruby-eql-and-equal-.html Equality in Ruby - == eql? and equal? The==comparison checks whether two values are equaleql?checks if two values are eq...

    原文 http://www.wellho.net/mouth/985_Equality-in-Ruby-eql-and-equal-.html

    Equality in Ruby - == eql? and equal?


    The == comparison checks whether two values are equal

    eql? checks if two values are equal and of the same type

    equal? checks if two things are one and the same object.

    How do I remember which is which ... The longer the operator, the more restrictive the test it performs


    irb(main):013:0> val = 17
    => 17
    irb(main):014:0> val == 17.0
    => true
    irb(main):015:0> val.eql?(17.0)
    => false
    irb(main):016:0> val.eql?(17)
    => true


    (1..10) === 5 # true: 5属于range 1..10
    /\d+/ === "123" # true: 字符串匹配这个模式
    String === "s" # true: "s" 是一个字符串类的实例
    :s === "s" # true
    irb(main):017:0> val.equal?(17)
    => true


  • <pre><code>// IsNumber reports whether the rune is a number (category N). func IsNumber(r rune) bool { if uint32(r) <= MaxLatin1 { return properties[uint8(r)]&pN != 0 } return ...
  • # Check whether current ratios is enough if abs(pruned_ratio - pruned_flops) < 0.015: break if pruned_ratio > pruned_flops: max_loss = loss else: min_loss = loss max_times -=...
  • <p>According to the man page, returning zero is clearly defined in C <code>write</code> call for to files and for non-blocking sockets, but it's unclear whether there are non-error conditions for a ...
  • <p>Can someone confirm whether they are equivalent or if there are any edge cases where these are different? Is there a preference to use one technique over the other? The ...
  • I've been using ./ thus far in my code and just discovered the existence of <code>__dirname, and essentially want to know whether it would be smart to convert my ./'s to that, and if so, why that ...
  • Do NOT use the `==`` operator to test whether two strings are equal! It only determines whether or not the strings are stored in the same location. Sure, if strings are in the same location, they...

    Do NOT use the `==`` operator to test whether two strings are equal! It only determines whether or not the strings are stored in the same location. Sure, if strings are in the same location, they must be equal. But it is entirely possible to store multiple copies of identical strings in different places.

    public class Understand_equals
    	public static void main(String[] args)
    		String x = "abcd";
    		String y = "abcd";
    		System.out.printf("x = y? %b\n", x == y);
    		System.out.printf("x.equals(y)? %b\n", x.equals(y));
    		String xx = "abcde";
    		String yy = new String("abcde");
    		System.out.printf("xx = yy? %b\n", xx == yy);
    		System.out.printf("xx.equals(yy)? %b\n", xx.equals(yy));


    x = y? true
    x.equals(y)? true
    xx = yy? false
    xx.equals(yy)? true
  • <p>Can someone explain to me whether one is more efficient than the other and in general compare when to choose what? Also if I need to interface with a non-golang application, I guess json would be ...
  • 不定代词all/any/none的区别

    千次阅读 2019-07-13 15:40:34
    这三个词都作用于三者或三者以上。 作为不定代词时三者翻译 含义 ... 用于否定句疑问句中或ifwhether后。 none 没有一个;毫无。 none of与不可数名词连用时,动词用单数;...
      含义 区别
    all 所有;全部;全体;一切;唯一的事物;所有的事物。 可用于否定句、肯定句和疑问句。
    any 任何数量,任一数额;任一;任何一些。 用于否定句和疑问句中或if、whether后。
    none 没有一个;毫无。 none of与不可数名词连用时,动词用单数;
    none of与复数名词、代词或单数集合名词连用时,动词用单数或复数均可。英国英语的正式文体用单数形
    all I invited some of my colleagues but not all.
    Not all of them were invited.
    All of them enjoyed the party.
    All I want is peace and quiet.
    It was all that I had.
    I swear I've told you all I know 
    This is all I have. 
    All I could say was, 'I'm sorry'. 
    any I need some stamps. Are there any in your bag?
    Please let me know how many are coming, if any.
    She spent hardly any of the money.
    He returned home without any of the others.
    I'll take any you don't want.
    Which colour do you want?Any of them will do.
    none None of the work was done.
    None of the trains is/are going to London.
    None of her family has/have been to college.
    None of these pens works/work.
    We have three sons but none of them lives/live nearby.
    We saw several houses but none we really liked.
    Tickets for Friday? Sorry we've got none left.
    He told me all the news but none of it was very exciting.
    Is there any more milk? No, none at all .


  • 我知道二者的区别,而且我觉得这个instanceof应该有点问题吧,就是比如a是父类,b是子类,且这时候子类的equals语义没有发生变化,那么a.equals(b)b.equals(a)的结果就不一样了吧,因为子类instanceof父类是true,...
  • 从资源定位的角度看 PWA 的区别 不同于传统页面或者 PWA,它们的资源定位符通常对应着服务端响应的资源。比如 <code>https://example.com/index.html</code> 通常对应的服务端/缓存返回的 index.html 文件。...
  •  145 肯定句中 must have to 的区别  146 need not must not 用于现在时将来时  147 need not , must not must 用于现在时将来时  148 need 的各种形式  149 表示无义务的各种形式 但是,...
  • C 标准I/O库粗略实现

    2020-12-08 19:40:13
    而stdinstdout都是带缓冲,明确说是行缓冲。本文不考虑行缓冲,默认都是全缓冲,即缓冲区满了才刷新缓冲区。(详细可以参考《UNIX环境高级编程》标准I/O库章节)。 现在我们...
  • 柏拉图学派具有这样概念,即 数学客体是抽象,远离日常感性经验:几何图形理想化,以区别于客体实际图样形状;数字不与具体客体计算相混淆。它们存在本性 出现了特殊哲学挑战:如何做到 数学...
  • 2009 达内Unix学习笔记

    2010-02-10 19:45:32
    ls /etc/ 显示某目录下所有文件目录,如etc目录下。 ls -l (list)列表显示文件(默认按文件名排序), 显示文件权限、硬链接数(即包含文件数,普通文件是1,目录1+)、用户、组名、大小、修改日期、文件名。 ...
  • 詞典格式 dict.txt 一樣,一個詞佔一行;每一行分為三部分,一部分為詞語,一部分為詞頻,一部分為詞性,用空格隔開 範例: 云计算 5 n 李小福 2 n 创新办 3 n 之前: 李小福 / 是 / 创新 / 办 / 主任 / 也 / 是...



1 2
收藏数 23
精华内容 9